﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="funcionarios.aspx.cs" Inherits="area_admin_equipamentos"  EnableEventValidation="false"%>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:Panel ID="Panel1" runat="server">
        <table style="width: 100%">
            <tr>
                <td>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                        ControlToValidate="txtDescricao" ErrorMessage="*" SetFocusOnError="True" 
                        ForeColor="#FF6699" Font-Size="16pt" Font-Names="Vrinda" 
                        ValidationGroup="insercao">*</asp:RequiredFieldValidator>
                    <br />
                    &nbsp;Nome do Funcionário:</td>
                <td>
                    <asp:TextBox ID="txtDescricao" runat="server" ValidationGroup="busca"></asp:TextBox>
                </td>
                <td width="100%">
                    <asp:Button ID="btnPesquisar" runat="server" onclick="btnPesquisar_Click" 
                        Text="Buscar" Width="70px" CausesValidation="False" />
                    <asp:Button ID="btnNovo" runat="server" CausesValidation="False" 
                        onclick="btnNovo_Click" Text="Novo Funcionário" Width="120px" />
                    &nbsp;</td>
            </tr>
            <tr>
                <td colspan="3">
                    <asp:CreateUserWizard ID="CreateUserWizard1" runat="server" 
                        ContinueDestinationPageUrl="~/Default2.aspx" CreateUserButtonText="Continuar" 
                        oncreateduser="CreateUserWizard1_CreatedUser" 
                        onfinishbuttonclick="CreateUserWizard1_FinishButtonClick" QuestionLabelText="" 
                        QuestionRequiredErrorMessage="" StepPreviousButtonText="" Visible="False">
                        <FinishNavigationTemplate>
                            <asp:Button ID="FinishButton" runat="server" CommandName="MoveComplete" 
                                Text="Concluir" />
                            &nbsp;<asp:Button ID="btnCancela0" runat="server" Text="Cancelar" />
                        </FinishNavigationTemplate>
                        <StepNavigationTemplate>
                            <asp:Button ID="StepNextButton" runat="server" CommandName="MoveNext" 
                                Text="Continuar" />
                            <asp:Button ID="btnCancela1" runat="server" Text="Cancelar" />
                        </StepNavigationTemplate>
                        <WizardSteps>
                            <asp:CreateUserWizardStep runat="server" Title="Crie seu usuário">
                                <ContentTemplate>
                                    <table border="0">
                                        <tr>
                                            <td align="center" class="titulo3" colspan="2">
                                                Crie um usuário</td>
                                        </tr>
                                        <tr>
                                            <td align="right">
                                                <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">Crie um nome de usuário:</asp:Label>
                                            </td>
                                            <td>
                                                <asp:TextBox ID="UserName" runat="server"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" 
                                                    ControlToValidate="UserName" ErrorMessage="User Name is required." 
                                                    ToolTip="User Name is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right">
                                                <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Crie uma senha:</asp:Label>
                                            </td>
                                            <td>
                                                <asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" 
                                                    ControlToValidate="Password" ErrorMessage="Password is required." 
                                                    ToolTip="Password is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right">
                                                <asp:Label ID="ConfirmPasswordLabel" runat="server" 
                                                    AssociatedControlID="ConfirmPassword">Confirme a senha:</asp:Label>
                                            </td>
                                            <td>
                                                <asp:TextBox ID="ConfirmPassword" runat="server" TextMode="Password"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="ConfirmPasswordRequired" runat="server" 
                                                    ControlToValidate="ConfirmPassword" 
                                                    ErrorMessage="Confirm Password is required." 
                                                    ToolTip="Confirm Password is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right">
                                                <asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email">E-mail:</asp:Label>
                                            </td>
                                            <td>
                                                <asp:TextBox ID="Email" runat="server"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="EmailRequired" runat="server" 
                                                    ControlToValidate="Email" ErrorMessage="E-mail is required." 
                                                    ToolTip="E-mail is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="right">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td align="center" colspan="2">
                                                <asp:CompareValidator ID="PasswordCompare" runat="server" 
                                                    ControlToCompare="Password" ControlToValidate="ConfirmPassword" 
                                                    Display="Dynamic" 
                                                    ErrorMessage="A senha e a confirmação de senha devem ser iguais." 
                                                    ValidationGroup="CreateUserWizard1"></asp:CompareValidator>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="center" colspan="2" style="color:Red;">
                                                <asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"></asp:Literal>
                                            </td>
                                        </tr>
                                    </table>
                                </ContentTemplate>
                            </asp:CreateUserWizardStep>
                            <asp:WizardStep ID="Cliente" runat="server" Title="Informações Básicas">
                                <asp:Panel ID="pnlInserir" runat="server" SkinID="Insercao" 
                                    Width="100%">
                                    <table style="padding: 3px; width: 100%">
                                        <tr>
                                            <td class="titulo3" colspan="2">
                                                Informações do novo funcionário</td>
                                        </tr>
                                        <tr>
                                            <td style="width: 193px; text-align: right;">
                                                * Nome:</td>
                                            <td>
                                                <asp:TextBox ID="txtNome" runat="server" Width="300px"></asp:TextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="width: 193px; text-align: right;">
                                                * CPF:</td>
                                            <td>
                                                <asp:TextBox ID="txtCPF" runat="server" Width="100px"></asp:TextBox>
                                                <cc1:MaskedEditExtender ID="txtCPF_MaskedEditExtender" runat="server" 
                                                    CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" 
                                                    CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" 
                                                    CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" 
                                                    Mask="999\.999\.999\-99" MaskType="Number" TargetControlID="txtCPF">
                                                </cc1:MaskedEditExtender>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="width: 193px; text-align: right;">
                                                * RG:
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtRG" runat="server" Width="100px"></asp:TextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="width: 193px; text-align: right;">
                                                Data de Nascimento:</td>
                                            <td>
                                                <asp:TextBox ID="txtDataNascimento" runat="server" Width="100px"></asp:TextBox>
                                                <cc1:MaskedEditExtender ID="txtDataNascimento_MaskedEditExtender" 
                                                    runat="server" CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" 
                                                    CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" 
                                                    CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" 
                                                    Mask="99\/99\/9999" MaskType="Date" TargetControlID="txtDataNascimento">
                                                </cc1:MaskedEditExtender>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="width: 193px; text-align: right;">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                    </table>
                                </asp:Panel>
                            </asp:WizardStep>
                            <asp:CompleteWizardStep runat="server" Title="Cadastro Concluído" />
                        </WizardSteps>
                    </asp:CreateUserWizard>
                    <br />
                </td>
            </tr>
        </table>
        <asp:GridView ID="grdFuncionarios" runat="server" AutoGenerateColumns="False" 
            DataSourceID="linqFuncionarios" DataKeyNames="idFuncionario" 
            onselectedindexchanged="grdSituacoes_SelectedIndexChanged" 
            EnableTheming="True" Width="380px" EmptyDataText="Nenhum equipamento encontrado." 
            onrowdeleting="grdEquipamentos_RowDeleting" 
            ondatabound="grdEquipamentos_DataBound" 
            onrowediting="grdEquipamentos_RowEditing" AllowPaging="True" SkinID="q">
            <Columns>
                <asp:TemplateField HeaderText="Lista de Funcionários" InsertVisible="False" 
                    SortExpression="idSituacao">
                    <EditItemTemplate>
                        <table style="width: 100%">
                            <tr>
                                <td ID="20">
                                    <asp:Panel ID="pnlEdit" runat="server" SkinID="Insercao" Width="100%">
                                        <table style="padding: 3px; width: 100%">
                                            <tr>
                                                <td class="titulo3" colspan="2">
                                                    Informações do novo funcionário</td>
                                            </tr>
                                            <tr>
                                                <td style="width: 193px; text-align: right;">
                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                                        ControlToValidate="txtNome" ErrorMessage="*" Font-Names="Vrinda" 
                                                        Font-Size="16pt" ForeColor="#FF6699" SetFocusOnError="True" 
                                                        ValidationGroup="insercao">*</asp:RequiredFieldValidator>
                                                    Nome:</td>
                                                <td>
                                                    <asp:TextBox ID="txtNome" runat="server" Text='<%# Bind("Nome") %>' 
                                                        Width="300px"></asp:TextBox>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td style="width: 193px; text-align: right;">
                                                    * CPF:</td>
                                                <td>
                                                    <asp:TextBox ID="txtCPF" runat="server" Text='<%# Bind("CPF") %>' Width="100px"></asp:TextBox>
                                                    <cc1:MaskedEditExtender ID="txtCPF_MaskedEditExtender" runat="server" 
                                                        CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder="" 
                                                        CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" 
                                                        CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" 
                                                        Mask="999\.999\.999\-99" MaskType="Number" TargetControlID="txtCPF">
                                                    </cc1:MaskedEditExtender>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td style="width: 193px; text-align: right;">
                                                    * RG:
                                                </td>
                                                <td>
                                                    <asp:TextBox ID="txtRG" runat="server" Text='<%# Bind("RG") %>' Width="100px"></asp:TextBox>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td style="width: 193px; text-align: right;">
                                                    Data de Nascimento:</td>
                                                <td>
                                                    <asp:TextBox ID="txtDataNascimento" runat="server" 
                                                        Text='<%# Bind("DataNascimento") %>' Width="100px"></asp:TextBox>
                                                    <cc1:MaskedEditExtender ID="txtDataNascimento_MaskedEditExtender" 
                                                        runat="server" ClearMaskOnLostFocus="False" CultureAMPMPlaceholder="" 
                                                        CultureCurrencySymbolPlaceholder="" CultureDateFormat="" 
                                                        CultureDatePlaceholder="" CultureDecimalPlaceholder="" 
                                                        CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" 
                                                        Mask="99\/99\/9999" MaskType="Date" TargetControlID="txtDataNascimento">
                                                    </cc1:MaskedEditExtender>
                                                    <asp:Label ID="Label4" runat="server" Text='<%# Bind("Foto") %>' 
                                                        Visible="False"></asp:Label>
                                                </td>
                                            </tr>
                                        </table>
                                    </asp:Panel>
                                </td>
                            </tr>
                            <tr>
                                <td ID="21" align="center">
                                    <asp:Button ID="btnSalvar" runat="server" CommandName="Update" Text="Salvar" 
                                        Width="100px" TabIndex="1" />
                                    &nbsp;<asp:Button ID="btnSalvar0" runat="server" CommandName="Cancel" 
                                        Text="Cancelar" Width="100px" TabIndex="2" />
                                </td>
                            </tr>
                        </table>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <table style="width: 100%">
                            <tr>
                                <td ID="2">
                                    <asp:Label ID="Label1" runat="server" Font-Bold="True" 
                                        Text='<%# Eval("Nome") %>' CssClass="titulo3"></asp:Label>
                                    <br />
                                    CPF:<asp:Label ID="Label2" runat="server" Font-Bold="True" 
                                        Text='<%# Eval("CPF", "{0:999.9999.999-99}") %>'></asp:Label>
                                    <br />
                                    Data de Nascimento:
                                    <asp:Label ID="Label3" runat="server" Font-Bold="True" 
                                        Text='<%# Eval("DataNascimento", "{0:d}") %>'></asp:Label>
                                    <br />
                                </td>
                                <td valign="top" width="80px">
                                    <asp:Button ID="Button2" runat="server" CommandName="Edit" 
                                        SkinID="EditarOnTop" ValidationGroup="edicao" />
                                    <asp:Button ID="Button1" runat="server" CommandName="Select" 
                                        SkinID="ExcluirOnTop" />
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        <asp:LinqDataSource ID="linqFuncionarios" runat="server" 
            ContextTypeName="dbSisInfoDataContext" EnableDelete="True" EnableUpdate="True" 
            OrderBy="Nome" TableName="FUNCIONARIOs" 
            Where="idFuncionario != @idFuncionario">
            <WhereParameters>
                <asp:Parameter DefaultValue="1" Name="idFuncionario" Type="Int32" />
            </WhereParameters>
        </asp:LinqDataSource>
        <asp:Panel ID="pnlConfirm" runat="server" Height="100px" 
            HorizontalAlign="Center" SkinID="Confirmacao" Width="300px">
            <br />
            <asp:Label ID="Label2" runat="server" Text="Deseja confirmar?"></asp:Label>
            <br />
            <br />
            <asp:Button ID="btnSim" runat="server" onclick="btnIncluir_Click" Text="Sim" 
                ValidationGroup="insercao" />
            <asp:Button ID="btnNao" runat="server" Text="Nao" />
            <br />
            <asp:UpdateProgress ID="UpdateProgress2" runat="server">
                <ProgressTemplate>
                    CARREGANDO...
                </ProgressTemplate>
            </asp:UpdateProgress>
        </asp:Panel>
        <asp:Panel ID="pnlConfirmDelete" runat="server" Height="100px" 
            HorizontalAlign="Center" SkinID="Confirmacao" Width="300px">
            <br />
            <asp:Label ID="Label3" runat="server" Text="Deseja confirmar?"></asp:Label>
            <br />
            <br />
            <asp:Button ID="btnSim0" runat="server" CausesValidation="False" Text="Sim" 
                onclick="btnSim0_Click" />
            <asp:Button ID="btnNao0" runat="server" CausesValidation="False" Text="Nao" />
            <br />
            <asp:UpdateProgress ID="UpdateProgress1" runat="server">
                <ProgressTemplate>
                    CARREGANDO...
                </ProgressTemplate>
            </asp:UpdateProgress>
        </asp:Panel>
        <asp:Label ID="lbDelete" runat="server" Text="."></asp:Label>
        <br />
        <cc1:ModalPopupExtender ID="Button1_ModalPopupExtender" runat="server" 
            BackgroundCssClass="modalBackground" CancelControlID="btnNao0" 
            DynamicServicePath="" Enabled="True" PopupControlID="pnlConfirmDelete" 
            TargetControlID="lbDelete">
        </cc1:ModalPopupExtender>
    </asp:Panel>
</asp:Content>

